<?php

namespace app\rabbitmq\job;

use app\api\library\Show;
use GrahamCampbell\ResultType\Success;
use PhpAmqpLib\Message\AMQPMessage;

abstract class BaseJob
{
    public function consumeMq(AMQPMessage $msg)
    {
        $data = json_decode($msg->body, true);
        //执行业务处理
        $result = $this->doJob($data);
        $msg->ack();
    }

    public function doJob($data)
    {
        return Show::success();
    }
}